package com.example.lotterysystem.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ActivityStatusEnum {

    COMPLETE(2, "活动已经完成"),

    RUNNING(1 , "活动进行中");

    private final Integer code;

    private final String message;

    public static ActivityStatusEnum forName (String name) {
        for (ActivityStatusEnum activityStautsEnum : ActivityStatusEnum.values()) {
            if (activityStautsEnum.name().equalsIgnoreCase(name)) {
                return activityStautsEnum;
            }
        }
        return null;
    }
}
